<template>
	<view>
		<view class="zhanwei"></view>
		<view class="item flex">
			<view class="item_left">
				报销人
			</view>
			<input type="text" placeholder="输入报销人" v-model="from.name" class="item_right"/>
		</view>
		<view class="item flex">
			<view class="item_left">
				报销账户
			</view>
			<input type="text" placeholder="输入报销账户" v-model="from.account" class="item_right"/>
		</view>
		<view class="item flex">
			<view class="item_left">
				开户行
			</view>
			<input type="text" placeholder="输入开户行" v-model="from.bank_name" class="item_right"/>
		</view>
		<view class="bottom">
			<view class="bottom_btn" @click="determine">
				保存
			</view>
		</view>
	</view>
</template>

<script>
	import {orderprepay,expenseInfo} from "@/api/common.js"
	export default {
		data() {
			return {
				from:{
					name:'',
					account:'',
					bank_name:'',
				}
			}
		},
		onLoad() {
			expenseInfo().then(res=>{
				console.log(res,'123');
				let obj = res.data;
				if(obj.account){
					this.from.name = obj.name;
					this.from.account = obj.account;
					this.from.bank_name = obj.bank_name;
				}
			})
		},
		methods: {
			determine(){
				let t = this
				orderprepay(t.from).then(res=>{
					console.log(res)
					if(res.code == 200001){
						uni.showToast({
							title:'提交成功',
							icon:'none'
						})
						setTimeout(()=>{
							uni.navigateBack()
						},1500)
					}
				})
			}
		}
	}
</script>

<style>
.zhanwei{
	width: 100%;
	height: 30rpx;
}
.item{
	width: 100%;
	height: 104rpx;
	padding: 0 30rpx;
	box-sizing: border-box;
	border-bottom: 1rpx solid #F4F4F4;;
}
.item_left{
	color: #333;
	font-family: Alibaba PuHuiTi 2.0;
	font-size: 32rpx;
	font-weight: 400;
	height: 104rpx;
	line-height: 104rpx;
}
.item_right{
	width: 70%;
	height: 104rpx;
	font-size: 32rpx;
	font-weight: 400;
	color: #333;
}
.bottom{
	width: 100%;
	height: 140rpx;
	background-color: #fff;
	position: fixed;
	bottom: 0;
	display: flex;
	align-items: center;
}
.bottom_btn{
	width: 690rpx;
	height: 90rpx;
	line-height: 90rpx;
	text-align: center;
	border-radius: 45rpx;
	background: #0165FB;
	margin: 0 auto;
	margin-top: -15rpx;
	color: #FFF;
	text-align: center;
	font-family: Alibaba PuHuiTi 2.0;
	font-size: 30rpx;
	font-style: normal;
	font-weight: 400;
}
</style>
